<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>DMS系统管理</title>
	<link rel="stylesheet" href="__PUBLIC__/css/style.css">
	<link rel="stylesheet" href="__PUBLIC__/css/font.css" />
	<script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
	<script type="text/javascript" src="__PUBLIC__/plugin/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="__PUBLIC__/plugin/layer/layer.js"></script>
<body style="background: #2a83cf repeat center center;">
<!--header start-->
<div class="header">
	<div class="h-left"><span style="font-size:24px; line-height:2.5;">分销管理系统</span></div>
	<div class="h-left2">
		<div class="nav">
			<ul>
				<foreach name="menuList" item="menuList">
					<li class="menuMain{$menuList['id']}"><a href="javascript:" onclick="menuParentChange('{$menuList['id']}')">{$menuList['name']}</a></li>
				</foreach>
			</ul>
		</div>
	</div>
	<div class="h-right">
		<div class="login-info">
			<span class="user">欢迎您,【<php>echo getIdentyName();</php>】,你所属部门【<php>echo getGroupName();</php>】</span><span class="message"><a href="{:U(MODULE_NAME.'/Message/index')}">信息<span class="mess-num"><php>echo getMessageNum();</php></span></a></span>
		</div>
		<div class="submenu-span">
			<span><a href="{:U(MODULE_NAME.'/Index/index')}">首页</a></span>
			<span><a href="{:U(MODULE_NAME.'/Auth/editPerson')}">修改个人资料</a></span>
			<span><a href="{:U(MODULE_NAME.'/Public/logout')}"><i class="icon-signout"></i>退出</a></span>
		</div>
	</div>

	<div class="clear"></div>
</div>
<!--header end-->

<!--main-->
<div id="main">
	<div class="layout_left">
		<div class="menu">
			<h2><span class="icon-list" style="padding-right:10px;"></span> 功能导航</h2>
			<php>$menu = menu();</php>

			<foreach name="menu" item="menu">
				<ul class="accordion" id="menuMain{$menu['id']}" style="display: none;">
					<foreach name="menu.parent" item="parent">

						<li class="" id="menuParent{$parent['id']}">

							<if condition="$parent['chlid'] neq false">

								<div class="link"> {$parent.name}<i class="arrow-down icon-chevron-down"></i></div>
								<ul class="submenu">
									<foreach name="parent.chlid" item="chlid">
										<li id="menuChlid{$chlid['id']}" >
											<a href="{:U($chlid['url'])}" >{$chlid.name}</a>
										</li>
									</foreach>
								</ul>

								<else />

								<a href="{:U($parent['url'])}" class="link">{$parent.name}</a>

							</if>

						</li>
					</foreach>
				</ul>
			</foreach>
			<!-- <div  class="QRCode">

                <img src="http://qr.liantu.com/api.php?bg=f3f3f3&fg=ff0000&gc=222222&el=l&w=200&m=10&text=<php>echo QRCode(getIdenty());</php>" style="winth: 100%;" />
            </div> -->
		</div>
	</div>
	<div class="layout_right">
		<div class="top">
			<div class="capt-lt">你尚未处理的信息有： <php>echo getMessageList();</php></div>
			<div class="capt-rt">当前时间：<span class="nowTime" style="font-size: 16px;"></span></div>
			<div class="subtitle"><span>{$menuName} </span></div>
		</div>
		<div class="content">
			<div class="content-wrap">
				{__CONTENT__}
			</div>
		</div>
	</div>
	<div class="clear"></div>
</div>

</head>
<!-- <!— WPA Button Begin —> -->
<script charset="utf-8" type="text/javascript" src="http://wpa.b.qq.com/cgi/wpa.php?key=XzkzODE3NjgwN18zNTIxMDRfNDAwNjQzNjI4NF8"></script>
<!-- <!— WPA Button END —> -->
<script type="text/javascript">
	function getNowTime()
	{
		var d = new Date();
		var showTime = '';

		var year = d.getFullYear();
		var month = d.getMonth()<10?'0'+(parseInt(d.getMonth())+1):(parseInt(d.getMonth())+1);
		var day = d.getDate()<10?'0'+d.getDate():d.getDate();
		var hour = d.getHours()<10?'0'+d.getHours():d.getHours();
		var minute = d.getMinutes()<10?'0'+d.getMinutes():d.getMinutes();
		var second = d.getSeconds()<10?'0'+d.getSeconds():d.getSeconds();
		var week;
		if(d.getDay()==0) week="星期日";
		if(d.getDay()==1) week="星期一";
		if(d.getDay()==2) week="星期二";
		if(d.getDay()==3) week="星期三";
		if(d.getDay()==4) week="星期四";
		if(d.getDay()==5) week="星期五";
		if(d.getDay()==6) week="星期六";

		showTime = year+'-'+month+'-'+day+' '+hour+':'+minute+':'+second+' '+week;
		$('.nowTime').html(showTime);
	}

	window.setInterval(function(){
		getNowTime();
	}, 1000);


	/**折叠菜单**/
	$(function() {
		getNowTime();
		menuInit("{$menuID}");
		var Accordion = function(el, multiple) {
			this.el = el || {};
			this.multiple = multiple || false;

			// Variables privadas
			var links = this.el.find('.link');
			if(links.length > 0)
			{
				links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown)
			}
			// Evento
		}

		Accordion.prototype.dropdown = function(e) {
			var $el = e.data.el;
			$this = $(this),
					$next = $this.next();

			$next.slideToggle();
			$this.parent().toggleClass('open');

			if (!e.data.multiple) {
				$el.find('.submenu').not($next).slideUp().parent().removeClass('open');
			};
		}

		var accordion = new Accordion($('.accordion'), false);
	});

	function menuParentChange(id)
	{
		$('.nav li').removeClass('current');
		$('.menuMain'+id).addClass('current');

		$('.accordion').removeClass('active');
		$('.accordion').hide();

		$('#menuMain'+id).addClass('active');
		$('#menuMain'+id).show();
	}

	function menuInit(id)
	{
		if($('#menuChlid'+id).length > 0)
		{
			$('.accordion').hide();
			$('#menuChlid'+id).parent().parent().parent().show();
			var idval = $('#menuChlid'+id).parent().parent().parent().attr('id');
			$('.'+idval).addClass('current');
			$('#menuChlid'+id).parent().parent().addClass('open');
			$('#menuChlid'+id).parent().show();
			$('#menuChlid'+id).addClass('active');
		}
		else
		{
			$('.accordion').hide();
			$('#menuParent'+id).parent().show();
			$('#menuParent'+id).addClass('open');
			var idval = $('#menuParent'+id).parent().attr('id');
			$('.'+idval).addClass('current');
		}

	}

</script>
</body>
</html>